<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta name="referrer" content="no-referrer"><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>小妖笔记 - 记录学习过程中的一些笔记，方便调用!</title><meta name="author" content="小妖"><meta name="copyright" content="小妖"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="常用开发中的笔记记录">
<meta property="og:type" content="website">
<meta property="og:title" content="小妖笔记">
<meta property="og:url" content="http://grace.666443.xyz/page/2/index.html">
<meta property="og:site_name" content="小妖笔记">
<meta property="og:description" content="常用开发中的笔记记录">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png">
<meta property="article:author" content="小妖">
<meta property="article:tag" content="笔记 开发">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="http://grace.666443.xyz/page/2/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"/search.xml","preload":true,"languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: {"chs_to_cht":"你已切换为繁体","cht_to_chs":"你已切换为简体","day_to_night":"你已切换为深色模式","night_to_day":"你已切换为浅色模式","bgLight":"#49b1f5","bgDark":"#1f1f1f","position":"bottom-left"},
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: '小妖笔记',
  isPost: false,
  isHome: true,
  isHighlightShrink: false,
  isToc: false,
  postUpdate: '2022-12-12 11:06:40'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 5.4.2"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">28</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">2</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">7</div></a></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fa fa-heartbeat"></i><span> 清单</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/photos/"><i class="fa-fw fas fa-images"></i><span> 照片</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> 电影</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="page" id="body-wrap"><header class="full_page" id="page-header" style="background-image: url('https://pic4.zhimg.com/v2-0de151579db0231cbaa001f3a4ca10c7_r.jpg')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">小妖笔记</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fa fa-heartbeat"></i><span> 清单</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/photos/"><i class="fa-fw fas fa-images"></i><span> 照片</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> 电影</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="site-info"><h1 id="site-title">小妖笔记</h1><div id="site-subtitle"><span id="subtitle"></span></div></div><div id="scroll-down"><i class="fas fa-angle-down scroll-down-effects"></i></div></header><main class="layout" id="content-inner"><div class="recent-posts" id="recent-posts"><div class="recent-post-item"><div class="post_cover left"><a href="/posts/2b5a0751.html" title="15.Python之Mysql数据库相关"><img class="post_bg" src="https://p.ananas.chaoxing.com/star3/origin/2a1821704670b5cf8c2289255e183d62.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="15.Python之Mysql数据库相关"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/2b5a0751.html" title="15.Python之Mysql数据库相关">15.Python之Mysql数据库相关</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-12-08T12:17:02.000Z" title="发表于 2022-12-08 20:17:02">2022-12-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/python%E5%9F%BA%E7%A1%80/">python基础</a></span></div><div class="content">Python第二阶段 - MYSQL数据库相关
章节目录
[!WARNING|label:本章需要学习的内容]


DDL  库管理
DDL  表管理

1.DDL 库+表管理DDL【库】管理

SQL代码演示

 1234567891011121314# 我是注释 查看数据库 show DATABASES;/* 使用数据库  use 数据库名; */USE emlog;# 创建数据库CREATE DATABASE python_1 CHARSET utf8;# 删除数据库DROP DATABASE python_1;# 查看当前使用的数据库 SELECT DATABASE();

DDL【表】管理  

表操作 代码演示

 1234567891011121314151617# 数据库名称 python_1# 选择哪个表 use python_1;# 查看有哪些表 show tables;# 创建表 CREATE table student(	id int,	name varchar(10),	age int); # 删除表 drop table student;


2.DML数据 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/posts/6ebaa02b.html" title="14.Python面向对象"><img class="post_bg" src="https://p.ananas.chaoxing.com/star3/origin/d24d9bfcd4ce3f910d6b5cdc78676d75.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="14.Python面向对象"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/6ebaa02b.html" title="14.Python面向对象">14.Python面向对象</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-12-08T12:10:47.000Z" title="发表于 2022-12-08 20:10:47">2022-12-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/python%E5%9F%BA%E7%A1%80/">python基础</a></span></div><div class="content">Python第二阶段 - 面向对象
章节目录
[!WARNING|label:本章需要学习的内容]


初识对象
成员方法
类和对象
构造方法
其他内置方法
封装
继承
类型注解
多态
综合案例

初识对象
教学视频

  


PPT资料

    

代码演示

1234567891011121314151617181920212223242526# 1. 设计一个类class Student:    name = None  # 学生姓名    gender = None  # 性别    nationality = None  # 国籍    native_place = None  # 籍贯    age = None  # 年龄# 2.创建一个对象stu_1 = Student()# 3.对象属性赋值stu_1.name = &quot;林俊杰&quot;stu_1.gender = &quot;男&quot;stu_1.nationality = &quot;中国&quot;stu_1.native_place = &quot;山东&quot;stu_1.age = 18 ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/posts/18141c11.html" title="13.Python综合案例-动态柱状图"><img class="post_bg" src="https://p.ananas.chaoxing.com/star3/origin/4f58efcc75f80e499f83b69e6a40f221.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="13.Python综合案例-动态柱状图"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/18141c11.html" title="13.Python综合案例-动态柱状图">13.Python综合案例-动态柱状图</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-12-08T12:04:06.000Z" title="发表于 2022-12-08 20:04:06">2022-12-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/python%E5%9F%BA%E7%A1%80/">python基础</a></span></div><div class="content">Python基础综合案例 数据可视化 - 动态柱状图
章节目录
[!WARNING|label:本章需要学习的内容]


基础柱状图
基础时间线柱状图
GDP动态柱状图绘制

练习的数据源1960-2019全球GDP数据.csv1960-2019全球GDP数据.csv.zip
基础柱状图
视频学习 

 


PPT资料

 

代码演示

123456789101112131415161718# 柱状图基础 from pyecharts.charts import Barfrom pyecharts.options import LabelOpts# 使用Bar 构建基础柱状图bar = Bar()# 添加x轴数据bar.add_xaxis([&quot;中国&quot;, &quot;美国&quot;, &quot;英国&quot;])# 添加Y轴数据bar.add_yaxis(&quot;GDP&quot;, [30, 20, 10], label_opts=LabelOpts(position=&quot;right&quot;))# 反转xy轴bar.reversal_axi ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/posts/e46ce5f3.html" title="12.Python综合案例-地图可视化"><img class="post_bg" src="https://p.ananas.chaoxing.com/star3/origin/05fcdda2bab7b7f1768a65f0c49762f8.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="12.Python综合案例-地图可视化"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/e46ce5f3.html" title="12.Python综合案例-地图可视化">12.Python综合案例-地图可视化</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-12-08T12:02:17.000Z" title="发表于 2022-12-08 20:02:17">2022-12-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/python%E5%9F%BA%E7%A1%80/">python基础</a></span></div><div class="content">Python入门课程  Python基础综合案例 数据可视化 - 地图可视化
章节目录
[!WARNING|label:本章需要学习的内容]


基础地图使用
疫情地图-国内疫情地图
疫情地图-省级疫情地图

基础地图使用
1. 掌握使用pyecharts构建基础的全国地图可视化图表



代码演示

1234567891011121314151617181920212223242526272829303132333435363738# Python基础综合案例 数据可视化 - 地图可视化from pyecharts.charts import Mapfrom pyecharts.options import VisualMapOpts# 创建地图对象map = Map()data = [    (&quot;北京&quot;, 11),    (&quot;上海&quot;, 2),    (&quot;广东&quot;, 30),    (&quot;四川&quot;, 40),    (&quot;江苏&quot;, 210),    (&quot;广州&quot;, 314), ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/posts/29d456a4.html" title="11.Python综合案例-折线可视化"><img class="post_bg" src="https://p.ananas.chaoxing.com/star3/origin/93817a1b7b5becae58da6acfc5d2c0c4.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="11.Python综合案例-折线可视化"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/29d456a4.html" title="11.Python综合案例-折线可视化">11.Python综合案例-折线可视化</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-12-08T12:00:55.000Z" title="发表于 2022-12-08 20:00:55">2022-12-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/python%E5%9F%BA%E7%A1%80/">python基础</a></span></div><div class="content">Python入门课程  Python基础综合案例:数据可视化 - 折线图可视化
章节目录
[!WARNING|label:本章需要学习的内容]


json数据格式
pyecharts模块介绍
pyecharts快速入门
数据处理
创建折线图

json数据格式
[!note|label:学习目标：]① 知道什么是json  ② 掌握如何使用json进行数据转化


pyecharts模块介绍
 总结
 123456781. 开发可视化图表使用的技术栈是：Echarts框架的Python版本：PyEcharts包2. 如何安装PyEcharts包：pip install pyecharts3. 如何查看官方示例打开官方画廊：https://gallery.pyecharts.org/#/README


pyecharts快速入门
[!note|label:学习目标：]① 构建一个基础的折线图  ② 使用全局配置项设置属性



代码演示

123456789101112131415161718192021222324252627282930313233# 导包，导入line功能构建折 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/posts/7257d1bd.html" title="10.Python异常.模块.包"><img class="post_bg" src="https://p.ananas.chaoxing.com/star3/origin/7ab42aabbf918bd08376d33683c57fc5.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="10.Python异常.模块.包"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/7257d1bd.html" title="10.Python异常.模块.包">10.Python异常.模块.包</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-12-08T11:59:51.000Z" title="发表于 2022-12-08 19:59:51">2022-12-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/python%E5%9F%BA%E7%A1%80/">python基础</a></span></div><div class="content">Python入门课程  Python异常、模块与包
章节目录
[!WARNING|label:本章需要学习的内容]


了解异常
异常的捕获方法
异常综合案例
Python模块
Python包
安装第三方Python包

了解异常

什么是异常： 异常就是程序运行的过程中出现了错误
bug是什么意思：bug就是指异常的意思，因为历史因为小虫子导致计算机失灵的案例，所以延续至今，bug就代表软件出现错误。


异常的捕获方法
学习目标  1.知道为什么要捕获异常 2.掌握捕获异常的语法格式


异常的传递
Python模块 - 1)模块的导入
[!note|label:学习目标：]①了解什么是模块 ②掌握导入Python内置的模块


Python模块 - 2)自定义模块
[!note|label:学习目标：]①了解如何自定义模块并使用 ② 了解__main__变量的作用


Python包 - 1)自定义包
[!note|label:学习目标：]①了解什么是Python包 ② 掌握如何自定义包


Python包 - 2)安装第三方包
[!note|label:学习目标：]①了解什么是 ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/posts/66462a4e.html" title="09.Python文件操作"><img class="post_bg" src="https://p.ananas.chaoxing.com/star3/origin/0ceb37b5df0be961614fe246b9d2048a.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="09.Python文件操作"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/66462a4e.html" title="09.Python文件操作">09.Python文件操作</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-12-08T11:58:50.000Z" title="发表于 2022-12-08 19:58:50">2022-12-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/python%E5%9F%BA%E7%A1%80/">python基础</a></span></div><div class="content">Python入门课程   文件操作
章节目录
[!WARNING|label:本章需要学习的内容]


文件的编码
文件的读取
文件的写入
文件的追加
文件操作综合案例

文件的编码UTF-8是目前全球通用的编码格式
除非有特殊需求，否则，一律以UTF-8格式进行文件编码即可。

[!note|style:callout|label:总结]1. 什么是编码？编码就是一种规则集合，记录了内容和二进制间进行相互转换的逻辑。编码有许多中，我们最常用的是UTF-8编码2. 为什么需要使用编码？计算机只认识0和1，所以需要将内容翻译成0和1才能保存在计算机中。同时也需要编码， 将计算机保存的0和1，反向翻译回可以识别的内容。

文件的读取
学习目标： ① 了解文件操作的作用   ②掌握文件的打开、读取、关闭操作



代码

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/posts/b515868e.html" title="08.Python函数进阶"><img class="post_bg" src="https://p.ananas.chaoxing.com/star3/origin/2be5cfbaf7fdc330fbcdbc43704e5405.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="08.Python函数进阶"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/b515868e.html" title="08.Python函数进阶">08.Python函数进阶</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-12-08T11:52:09.000Z" title="发表于 2022-12-08 19:52:09">2022-12-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/python%E5%9F%BA%E7%A1%80/">python基础</a></span></div><div class="content">Python入门课程   函数进阶
章节目录
[!WARNING|label:本章需要学习的内容]


函数多返回值
函数多种传参方式
匿名函数

函数多返回值
学习目标：知道函数如何返回多个返回值


函数多种传参方式
学习目标：使用方式上的不同, 函数有4中常见参数使用方式:


位置参数
关键字参数
缺省参数
不定长参数


匿名函数
学习目标 1：掌握函数作为参数传递



学习目标 2： 掌握lambda匿名函数的语法


</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/posts/24e420f7.html" title="07.Python数据容器"><img class="post_bg" src="https://p.ananas.chaoxing.com/star3/origin/f284fb2dc534d3975a7733ab0eb843eb.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="07.Python数据容器"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/24e420f7.html" title="07.Python数据容器">07.Python数据容器</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-12-08T11:51:23.000Z" title="发表于 2022-12-08 19:51:23">2022-12-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/python%E5%9F%BA%E7%A1%80/">python基础</a></span></div><div class="content">Python入门课程  数据容器
章节目录
[!WARNING|label:本章需要学习的内容]


数据容器入门
数据容器：list(列表)
list（列表）的遍历
数据容器：tuple(元组)
数据容器：str(字符串)
数据容器的切片
数据容器：set(集合)
数据容器：dict(字典、映射)
数据容器的通用操作
综合案例

数据容器入门
数据容器：list(列表)
[!tip|style:callout|label:列表] ①列表的定义②列表的下标索引③列表的常用操作

①列表的定义
②列表的下标索引
③列表的常用操作
学习目标：掌握列表的常用操作（方法）和特点



代码演示

12345678910111213141516171819202122232425my_list = [1, 2, 3, 4, 5, 6]# 查询某元素所在的下标index = my_list.index(1)print(index)# 修改某索引的值my_list[2] = &#x27;java&#x27;print(my_list)# 插入元素my_list.insert(1, &#x27;php ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/posts/b2d84ecf.html" title="06.Python函数"><img class="post_bg" src="https://p.ananas.chaoxing.com/star3/origin/561b31d5498e9c25ac5416d4.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="06.Python函数"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/b2d84ecf.html" title="06.Python函数">06.Python函数</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-12-08T11:50:28.000Z" title="发表于 2022-12-08 19:50:28">2022-12-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/python%E5%9F%BA%E7%A1%80/">python基础</a></span></div><div class="content">Python入门课程  函数
章节目录
[!WARNING|label:本章需要学习的内容]


函数介绍
函数的定义
函数的参数
函数的返回值
函数说明文档
函数的嵌套调用
变量的作用域
综合案例 

函数介绍
函数的定义

练习题代码

1234def welcome():    print(&quot;请出示您的健康码以及72小时核酸证明！&quot;) welcome() 
函数的参数

练习题代码

12345678910def check(num):    print(&quot;请出示您的健康码以及72小时核酸证明,并配合测量体温&quot;)    if num &lt;= 37.5:        print(f&quot;体温测试中，体温&#123;num&#125;,正常&quot;)    else:        print(f&quot;体温&#123;num&#125;,需要隔离&quot;)# 调用函数check(37)

函数的返回值
函数返回值的定义
None类型


[!tip|style:callout|label:①函数返回值的定义] 



 ...</div></div></div><nav id="pagination"><div class="pagination"><a class="extend prev" rel="prev" href="/"><i class="fas fa-chevron-left fa-fw"></i></a><a class="page-number" href="/">1</a><span class="page-number current">2</span><a class="page-number" href="/page/3/#content-inner">3</a><a class="extend next" rel="next" href="/page/3/#content-inner"><i class="fas fa-chevron-right fa-fw"></i></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">小妖</div><div class="author-info__description">常用开发中的笔记记录</div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">28</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">2</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">7</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/xxxxxx"><i class="fab fa-github"></i><span>Follow Me</span></a></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">This is my Blog 技术笔记</div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/posts/18ae4187.html" title="Python项目0002 - 超星小组云盘批量上传图片"><img src="http://pic.qqbizhi.com/allimg/bbpic/92/3692_4.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Python项目0002 - 超星小组云盘批量上传图片"/></a><div class="content"><a class="title" href="/posts/18ae4187.html" title="Python项目0002 - 超星小组云盘批量上传图片">Python项目0002 - 超星小组云盘批量上传图片</a><time datetime="2022-12-10T15:52:50.000Z" title="发表于 2022-12-10 23:52:50">2022-12-10</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/fe5af520.html" title="Python项目0001 - B站视频无水印解析"><img src="https://pic1.zhimg.com/v2-1b0b3d48f5259a87189012f8d7e9b370_r.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Python项目0001 - B站视频无水印解析"/></a><div class="content"><a class="title" href="/posts/fe5af520.html" title="Python项目0001 - B站视频无水印解析">Python项目0001 - B站视频无水印解析</a><time datetime="2022-12-10T15:17:28.000Z" title="发表于 2022-12-10 23:17:28">2022-12-10</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/3f24dd85.html" title="05.hexo视频教程"><img src="https://i1.hdslb.com/bfs/archive/cf6a8413b8ec8bd17612c2b48055be269b7ff496.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="05.hexo视频教程"/></a><div class="content"><a class="title" href="/posts/3f24dd85.html" title="05.hexo视频教程">05.hexo视频教程</a><time datetime="2022-12-09T16:26:08.000Z" title="发表于 2022-12-10 00:26:08">2022-12-10</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/afee721f.html" title="0001.超星网盘直链"><img src="http://p.ananas.chaoxing.com/star3/origin/6ed6e3f7288e00f92ed58e6e018e76cd.jpg?rw=640&amp;rh=258" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="0001.超星网盘直链"/></a><div class="content"><a class="title" href="/posts/afee721f.html" title="0001.超星网盘直链">0001.超星网盘直链</a><time datetime="2022-12-09T16:19:40.000Z" title="发表于 2022-12-10 00:19:40">2022-12-10</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/e76c3612.html" title="03.hexo文章标签配置"><img src="http://img.netbian.com/file/20150311/018c085855710a01c71d88a48a3270fe.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="03.hexo文章标签配置"/></a><div class="content"><a class="title" href="/posts/e76c3612.html" title="03.hexo文章标签配置">03.hexo文章标签配置</a><time datetime="2022-12-08T13:47:38.000Z" title="发表于 2022-12-08 21:47:38">2022-12-08</time></div></div></div></div><div class="card-widget card-categories"><div class="item-headline">
            <i class="fas fa-folder-open"></i>
            <span>分类</span>
            
            </div>
            <ul class="card-category-list" id="aside-cat-list">
            <li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Python%E5%AE%9E%E6%88%98%E9%A1%B9%E7%9B%AE/"><span class="card-category-list-name">Python实战项目</span><span class="card-category-list-count">2</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Python%E7%88%AC%E8%99%AB/"><span class="card-category-list-name">Python爬虫</span><span class="card-category-list-count">3</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/hexo/"><span class="card-category-list-name">hexo</span><span class="card-category-list-count">5</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/python%E5%9F%BA%E7%A1%80/"><span class="card-category-list-name">python基础</span><span class="card-category-list-count">15</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/python%E5%AD%A6%E4%B9%A0%E6%95%99%E7%A8%8B/"><span class="card-category-list-name">python学习教程</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/tkinter%E7%95%8C%E9%9D%A2%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91%E6%95%99%E7%A8%8B/"><span class="card-category-list-name">tkinter界面应用开发教程</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E8%B6%85%E6%98%9F%E7%BD%91%E7%9B%98%E7%9B%B4%E9%93%BE/"><span class="card-category-list-name">超星网盘直链</span><span class="card-category-list-count">1</span></a></li>
            </ul></div><div class="card-widget card-tags"><div class="item-headline"><i class="fas fa-tags"></i><span>标签</span></div><div class="card-tag-cloud"><a href="/tags/hexo%E7%9B%B8%E5%85%B3/" style="font-size: 1.1em; color: #999">hexo相关</a> <a href="/tags/tkinter/" style="font-size: 1.1em; color: #999">tkinter</a></div></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>归档</span></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/12/"><span class="card-archive-list-date">十二月 2022</span><span class="card-archive-list-count">28</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>网站资讯</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">文章数目 :</div><div class="item-count">28</div></div><div class="webinfo-item"><div class="item-name">本站访客数 :</div><div class="item-count" id="busuanzi_value_site_uv"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">本站总访问量 :</div><div class="item-count" id="busuanzi_value_site_pv"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">最后更新时间 :</div><div class="item-count" id="last-push-date" data-lastPushDate="2022-12-12T03:06:40.103Z"><i class="fa-solid fa-spinner fa-spin"></i></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2022 By 小妖</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text"><a target="_blank" rel="noopener" href='https://butterfly.js.org/'>Butterfly主题配置</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span>  数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div></div></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.min.js"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><script src="/js/search/local-search.js"></script><div class="js-pjax"><script>function subtitleType () {
  if (true) { 
    window.typed = new Typed("#subtitle", {
      strings: ["记录学习过程中的一些笔记，方便调用!"],
      startDelay: 300,
      typeSpeed: 150,
      loop: true,
      backSpeed: 50
    })
  } else {
    document.getElementById("subtitle").innerHTML = '记录学习过程中的一些笔记，方便调用!'
  }
}

if (true) {
  if (typeof Typed === 'function') {
    subtitleType()
  } else {
    getScript('https://cdn.jsdelivr.net/npm/typed.js/lib/typed.min.js').then(subtitleType)
  }
} else {
  subtitleType()
}</script><script>(() => {
  const $mermaidWrap = document.querySelectorAll('#article-container .mermaid-wrap')
  if ($mermaidWrap.length) {
    window.runMermaid = () => {
      window.loadMermaid = true
      const theme = document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'default'

      Array.from($mermaidWrap).forEach((item, index) => {
        const mermaidSrc = item.firstElementChild
        const mermaidThemeConfig = '%%{init:{ \'theme\':\'' + theme + '\'}}%%\n'
        const mermaidID = 'mermaid-' + index
        const mermaidDefinition = mermaidThemeConfig + mermaidSrc.textContent
        mermaid.mermaidAPI.render(mermaidID, mermaidDefinition, (svgCode) => {
          mermaidSrc.insertAdjacentHTML('afterend', svgCode)
        })
      })
    }

    const loadMermaid = () => {
      window.loadMermaid ? runMermaid() : getScript('https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js').then(runMermaid)
    }

    window.pjax ? loadMermaid() : document.addEventListener('DOMContentLoaded', loadMermaid)
  }
})()</script></div><script defer="defer" id="ribbon" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/canvas-ribbon.min.js" size="150" alpha="0.6" zIndex="-1" mobile="false" data-click="false"></script><div class="fb-customerchat" id="fb-customer-chat" attribution="biz_inbox"></div><script>document.getElementById('fb-root') ? '' : document.body.insertAdjacentHTML('afterend', '<div id="fb-root"></div>')

window.fbAsyncInit = function() {
  FB.init({
    xfbml: true,
    version: 'v15.0'
  });
};

(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = 'https://connect.facebook.net/zh_CN/sdk/xfbml.customerchat.js';
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

if (false) {
  var chatBtnFn = () => {
    var chatBtn = document.getElementById("chat_btn")
    chatBtn.addEventListener("click", function(){
      FB.CustomerChat.show();
    });
  }
  chatBtnFn()
} else {
  if (false) {
    function chatBtnHide () {
      FB.CustomerChat.hide()
    }
    function chatBtnShow () {
      FB.CustomerChat.show(false)
    }
  }
}</script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>